package com.front.handler;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.front.report.RepDataHandlerService;

@Service("lotteryTypeHandler")
public class LotteryTypeDataHandler implements RepDataHandlerService{

	@Override
	public Object handlerRepData(List<Map<String, Object>> srcData, Map<String, Object> query) throws Exception
	{
		List<Map<String, Object>>list= new ArrayList<Map<String,Object>>();
		Map<String,Object>result = new HashMap<String, Object>();
		if(srcData!=null&&!srcData.isEmpty())
		{
			List<Map<String, Object>>pgs = new ArrayList<Map<String,Object>>();
			for(Map<String,Object>src:srcData)
			{
			    if(result.isEmpty())
			    {
				  result.put("id", src.get("id"));
				  result.put("lottery_lname", src.get("lottery_lname"));
				  result.put("lottery_num", src.get("lottery_num"));
				  result.put("lottery_type", src.get("lottery_type")); 
				  result.put("singleContinueBetting", src.get("singleContinueBetting"));
			    }
			    src.remove("singleContinueBetting");
				src.remove("id");
				src.remove("lottery-type");
				src.remove("lottery_lname");
				src.remove("lottery_num");
			    pgs.add(src);
			}
			result.put("playGroups", pgs);
		}
		if(!result.isEmpty())
		{
			list.add(result);
		}
		return list;
	}

}
